package com.ruoyi.settled.mapper;

import com.ruoyi.settled.domain.AgreementRule;
import com.ruoyi.settled.domain.SettlementAgreement;

import java.util.List;

/**
 * 结算协议Mapper接口
 * 
 * @author huangchen
 * @date 2025-01-18
 */
public interface SettlementAgreementMapper 
{
    /**
     * 查询结算协议
     *
     * @param partnerCode 结算协议外键
     * @return 结算协议
     */
    public  SettlementAgreement selectSettlementAgreementByPartnerCode(String partnerCode);


    /**
     * 查询结算协议
     * 
     * @param agreementCode 结算协议主键
     * @return 结算协议
     */
    public SettlementAgreement selectSettlementAgreementByAgreementCode(String agreementCode);

    /**
     * 查询结算协议列表
     * 
     * @param settlementAgreement 结算协议
     * @return 结算协议集合
     */
    public List<SettlementAgreement> selectSettlementAgreementList(SettlementAgreement settlementAgreement);

    /**
     * 新增结算协议
     * 
     * @param settlementAgreement 结算协议
     * @return 结果
     */
    public int insertSettlementAgreement(SettlementAgreement settlementAgreement);

    /**
     * 修改结算协议
     * 
     * @param settlementAgreement 结算协议
     * @return 结果
     */
    public int updateSettlementAgreement(SettlementAgreement settlementAgreement);

    /**
     * 删除结算协议
     * 
     * @param agreementCode 结算协议主键
     * @return 结果
     */
    public int deleteSettlementAgreementByAgreementCode(String agreementCode);

    /**
     * 批量删除结算协议
     * 
     * @param agreementCodes 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSettlementAgreementByAgreementCodes(String[] agreementCodes);

    /**
     * 批量删除协议规则
     * 
     * @param agreementCodes 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAgreementRuleByAgreementCodes(String[] agreementCodes);
    
    /**
     * 批量新增协议规则
     * 
     * @param agreementRuleList 协议规则列表
     * @return 结果
     */
    public int batchAgreementRule(List<AgreementRule> agreementRuleList);
    

    /**
     * 通过结算协议主键删除协议规则信息
     * 
     * @param agreementCode 结算协议ID
     * @return 结果
     */
    public int deleteAgreementRuleByAgreementCode(String agreementCode);

    int existsByAgreementCode(String agreementCode);


    public String selectAgreementCodeByPartnerCode(String partnerCode);
}
